Optimal. Leaf size=93 \[ \frac {x}{b^2}-\frac {\sqrt {a} (2 a+3 b) \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{2 b^2 (a+b)^{3/2} d}+\frac {a \tan (c+d x)}{2 b (a+b) d \left (a+(a+b) \tan ^2(c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3266, 481, 536,
209, 211} \begin {gather*} -\frac {\sqrt {a} (2 a+3 b) \text {ArcTan}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{2 b^2 d (a+b)^{3/2}}+\frac {a \tan (c+d x)}{2 b d (a+b) \left ((a+b) \tan ^2(c+d x)+a\right )}+\frac {x}{b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 211
Rule 481
Rule 536
Rule 3266
Rubi steps
\begin {align*} \int \frac {\sin ^4(c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx &=\frac {\text {Subst}\left (\int \frac {x^4}{\left (1+x^2\right ) \left (a+(a+b) x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {a \tan (c+d x)}{2 b (a+b) d \left (a+(a+b) \tan ^2(c+d x)\right )}-\frac {\text {Subst}\left (\int \frac {a+(-a-2 b) x^2}{\left (1+x^2\right ) \left (a+(a+b) x^2\right )} \, dx,x,\tan (c+d x)\right )}{2 b (a+b) d}\\ &=\frac {a \tan (c+d x)}{2 b (a+b) d \left (a+(a+b) \tan ^2(c+d x)\right )}+\frac {\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{b^2 d}-\frac {(a (2 a+3 b)) \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\tan (c+d x)\right )}{2 b^2 (a+b) d}\\ &=\frac {x}{b^2}-\frac {\sqrt {a} (2 a+3 b) \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{2 b^2 (a+b)^{3/2} d}+\frac {a \tan (c+d x)}{2 b (a+b) d \left (a+(a+b) \tan ^2(c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.59, size = 93, normalized size = 1.00 \begin {gather*} \frac {2 (c+d x)-\frac {\sqrt {a} (2 a+3 b) \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{(a+b)^{3/2}}+\frac {a b \sin (2 (c+d x))}{(a+b) (2 a+b-b \cos (2 (c+d x)))}}{2 b^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.35, size = 101, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {\frac {\arctan \left (\tan \left (d x +c \right )\right )}{b^{2}}-\frac {a \left (-\frac {b \tan \left (d x +c \right )}{2 \left (a +b \right ) \left (a \left (\tan ^{2}\left (d x +c \right )\right )+b \left (\tan ^{2}\left (d x +c \right )\right )+a \right )}+\frac {\left (2 a +3 b \right ) \arctan \left (\frac {\left (a +b \right ) \tan \left (d x +c \right )}{\sqrt {a \left (a +b \right )}}\right )}{2 \left (a +b \right ) \sqrt {a \left (a +b \right )}}\right )}{b^{2}}}{d}\) | \(101\) |
default | \(\frac {\frac {\arctan \left (\tan \left (d x +c \right )\right )}{b^{2}}-\frac {a \left (-\frac {b \tan \left (d x +c \right )}{2 \left (a +b \right ) \left (a \left (\tan ^{2}\left (d x +c \right )\right )+b \left (\tan ^{2}\left (d x +c \right )\right )+a \right )}+\frac {\left (2 a +3 b \right ) \arctan \left (\frac {\left (a +b \right ) \tan \left (d x +c \right )}{\sqrt {a \left (a +b \right )}}\right )}{2 \left (a +b \right ) \sqrt {a \left (a +b \right )}}\right )}{b^{2}}}{d}\) | \(101\) |
risch | \(\frac {x}{b^{2}}-\frac {i a \left (2 a \,{\mathrm e}^{2 i \left (d x +c \right )}+b \,{\mathrm e}^{2 i \left (d x +c \right )}-b \right )}{b^{2} \left (a +b \right ) d \left (-b \,{\mathrm e}^{4 i \left (d x +c \right )}+4 a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-b \right )}+\frac {\sqrt {-a \left (a +b \right )}\, a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{2 \left (a +b \right )^{2} d \,b^{2}}+\frac {3 \sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{4 \left (a +b \right )^{2} d b}-\frac {\sqrt {-a \left (a +b \right )}\, a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{2 \left (a +b \right )^{2} d \,b^{2}}-\frac {3 \sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{4 \left (a +b \right )^{2} d b}\) | \(307\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 109, normalized size = 1.17 \begin {gather*} \frac {\frac {a \tan \left (d x + c\right )}{a^{2} b + a b^{2} + {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} \tan \left (d x + c\right )^{2}} - \frac {{\left (2 \, a^{2} + 3 \, a b\right )} \arctan \left (\frac {{\left (a + b\right )} \tan \left (d x + c\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{{\left (a b^{2} + b^{3}\right )} \sqrt {{\left (a + b\right )} a}} + \frac {2 \, {\left (d x + c\right )}}{b^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 191 vs.
\(2 (81) = 162\).
time = 0.46, size = 492, normalized size = 5.29 \begin {gather*} \left [\frac {8 \, {\left (a b + b^{2}\right )} d x \cos \left (d x + c\right )^{2} - 4 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 8 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} d x + {\left ({\left (2 \, a b + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 5 \, a b - 3 \, b^{2}\right )} \sqrt {-\frac {a}{a + b}} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left ({\left (2 \, a^{2} + 3 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{3} - {\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt {-\frac {a}{a + b}} \sin \left (d x + c\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (d x + c\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right )}{8 \, {\left ({\left (a b^{3} + b^{4}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} d\right )}}, \frac {4 \, {\left (a b + b^{2}\right )} d x \cos \left (d x + c\right )^{2} - 2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} d x + {\left ({\left (2 \, a b + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 5 \, a b - 3 \, b^{2}\right )} \sqrt {\frac {a}{a + b}} \arctan \left (\frac {{\left ({\left (2 \, a + b\right )} \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt {\frac {a}{a + b}}}{2 \, a \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right )}{4 \, {\left ({\left (a b^{3} + b^{4}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 140, normalized size = 1.51 \begin {gather*} -\frac {\frac {{\left (\pi \left \lfloor \frac {d x + c}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (d x + c\right ) + b \tan \left (d x + c\right )}{\sqrt {a^{2} + a b}}\right )\right )} {\left (2 \, a^{2} + 3 \, a b\right )}}{{\left (a b^{2} + b^{3}\right )} \sqrt {a^{2} + a b}} - \frac {a \tan \left (d x + c\right )}{{\left (a \tan \left (d x + c\right )^{2} + b \tan \left (d x + c\right )^{2} + a\right )} {\left (a b + b^{2}\right )}} - \frac {2 \, {\left (d x + c\right )}}{b^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 15.23, size = 1959, normalized size = 21.06 \begin {gather*} \frac {a\,\mathrm {tan}\left (c+d\,x\right )}{2\,d\,\left (\left (a+b\right )\,{\mathrm {tan}\left (c+d\,x\right )}^2+a\right )\,\left (b^2+a\,b\right )}-\frac {\mathrm {atan}\left (\frac {\frac {\frac {-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,b^2\,\left (b^3+a\,b^2\right )}+\frac {\left (2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6\right )\,1{}\mathrm {i}}{2\,\left (b^4+a\,b^3\right )}}{2\,b^2}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )}{4\,\left (b^3+a\,b^2\right )}}{b^2}-\frac {\frac {\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,b^2\,\left (b^3+a\,b^2\right )}+\frac {\left (2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6\right )\,1{}\mathrm {i}}{2\,\left (b^4+a\,b^3\right )}}{2\,b^2}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )}{4\,\left (b^3+a\,b^2\right )}}{b^2}}{\frac {a^3+\frac {7\,a^2\,b}{2}+3\,a\,b^2}{b^4+a\,b^3}+\frac {\frac {\left (-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,b^2\,\left (b^3+a\,b^2\right )}+\frac {\left (2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6\right )\,1{}\mathrm {i}}{2\,\left (b^4+a\,b^3\right )}\right )\,1{}\mathrm {i}}{2\,b^2}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )\,1{}\mathrm {i}}{4\,\left (b^3+a\,b^2\right )}}{b^2}+\frac {\frac {\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,b^2\,\left (b^3+a\,b^2\right )}+\frac {\left (2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6\right )\,1{}\mathrm {i}}{2\,\left (b^4+a\,b^3\right )}\right )\,1{}\mathrm {i}}{2\,b^2}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )\,1{}\mathrm {i}}{4\,\left (b^3+a\,b^2\right )}}{b^2}}\right )}{b^2\,d}-\frac {\mathrm {atan}\left (\frac {\frac {\sqrt {-a\,{\left (a+b\right )}^3}\,\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )}{2\,\left (b^3+a\,b^2\right )}-\frac {\left (\frac {2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6}{b^4+a\,b^3}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,\left (b^3+a\,b^2\right )\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\left (2\,a+3\,b\right )\,1{}\mathrm {i}}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}+\frac {\sqrt {-a\,{\left (a+b\right )}^3}\,\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )}{2\,\left (b^3+a\,b^2\right )}+\frac {\left (\frac {2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6}{b^4+a\,b^3}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,\left (b^3+a\,b^2\right )\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\left (2\,a+3\,b\right )\,1{}\mathrm {i}}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}}{\frac {a^3+\frac {7\,a^2\,b}{2}+3\,a\,b^2}{b^4+a\,b^3}-\frac {\sqrt {-a\,{\left (a+b\right )}^3}\,\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )}{2\,\left (b^3+a\,b^2\right )}-\frac {\left (\frac {2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6}{b^4+a\,b^3}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,\left (b^3+a\,b^2\right )\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\left (2\,a+3\,b\right )}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}+\frac {\sqrt {-a\,{\left (a+b\right )}^3}\,\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (8\,a^4+28\,a^3\,b+33\,a^2\,b^2+16\,a\,b^3+4\,b^4\right )}{2\,\left (b^3+a\,b^2\right )}+\frac {\left (\frac {2\,a^3\,b^4+4\,a^2\,b^5+2\,a\,b^6}{b^4+a\,b^3}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )\,\left (32\,a^4\,b^4+112\,a^3\,b^5+144\,a^2\,b^6+80\,a\,b^7+16\,b^8\right )}{8\,\left (b^3+a\,b^2\right )\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}\right )\,\left (2\,a+3\,b\right )}{4\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )}}\right )\,\sqrt {-a\,{\left (a+b\right )}^3}\,\left (2\,a+3\,b\right )\,1{}\mathrm {i}}{2\,d\,\left (a^3\,b^2+3\,a^2\,b^3+3\,a\,b^4+b^5\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________